import http  from "@/http";
import { GoodsType,ListGoodsParm } from "./GoodsModel";
//新增
export const addGoodsApi = (parm:GoodsType)=>{
    return http.post("/api/goods",parm)
}
//列表
export const getGoodsListApi = (parm:ListGoodsParm)=>{
    return http.get("/api/goods",parm)
}
//编辑
export const editGoodsApi = (parm:GoodsType)=>{
    const url = `api/goods/${parm.goodsId}`
    return http.post(url,parm)
}
//删除
export const deleteGoodsApi = (goodsId:string)=>{
    return http.get(`api/goods/${goodsId}`)
}
//获取在添加商品时的下拉列表
export const getSelectListApi = ()=>{
    return http.get("/api/goods/list")
}